<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions">

<h:head>
	<h:outputStylesheet name="global.css" library="css" />
	<h:outputScript name="global.js" library="javascript"/>
	<h:outputScript name="validacao.js" library="javascript"/>
	<h:outputScript name="restricoes_de_campos.js" library="javascript"/>
</h:head>

<h:body>
	<h1>Filtro</h1>
	
	<div class="form_title">
		<span class="active"><h:outputText
				value="Relatório de vigência de tabela de taxas e comissões - Filtro" /></span>
	</div>
	
	<h:form id="list">
		
		<p:messages id="messages" />
		<p:focus for="selectLojas"/>

		<p:panelGrid styleClass="panelGridCenter gridNoBackground noBorders">
			
			<p:row>
				<p:column styleClass="columnRight">
					<p:outputLabel value="Loja(s)"/>
				</p:column>

				<p:column>
					<p:selectCheckboxMenu id="selectLojas" value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.lojas}" style="display: block; width:100%;" filter="true" filterMatchMode="contains">
						<f:selectItems var="loja" itemLabel="#{loja.id} - #{loja.nomeFantasia}" value="#{relatorioVigenciaTabelaTaxasComissoesBean.helper.lojas}"/>
						<p:ajax event="change" process="@this" update="qtdLojas"/>
						<p:ajax event="toggleSelect" process="@this" update="qtdLojas"/>
					</p:selectCheckboxMenu>
					<p:outputLabel id="qtdLojas" value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.lojas.size()}"/>
				</p:column>
				
				<p:column styleClass="columnRight">
					<p:outputLabel value="Intervalo de vigência"/>
				</p:column>
				
				<p:column>
					<p:calendar
						value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.intervaloVigenciaInicial}"
						pattern="dd/MM/yyyy" locale="pt_BR" size="16"
						onfocus="inserirMascara();">
						<f:convertDateTime pattern="dd/MM/yyyy" />
					</p:calendar>
					&nbsp;&nbsp;a&nbsp;&nbsp;
					<p:calendar
						value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.intervaloVigenciaFinal}"
						pattern="dd/MM/yyyy" locale="pt_BR" size="16"
						onfocus="inserirMascara();">
						<f:convertDateTime pattern="dd/MM/yyyy" />
					</p:calendar>
				</p:column>
			</p:row>

			<p:row>
				<p:column styleClass="columnRight">
					<p:outputLabel value="Produto"/>
				</p:column>
				
				<p:column>
					<p:selectOneMenu
					value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.produtoEmprestimo}"
						style="width:100%;" filter="true" filterMatchMode="contains" required="true">
						<f:selectItem itemValue="#{null}" itemLabel="" noSelectionOption="true" />
		          	 	<f:selectItems var="produto" value="#{relatorioVigenciaTabelaTaxasComissoesBean.helper.produtosEmprestimo}"
							itemLabel="#{produto.id} - #{produto.nome}" itemValue="#{produto}"/>
     				</p:selectOneMenu>					
				</p:column>
				
				<p:column styleClass="columnRight">
					<p:outputLabel value="Código da tabela"/>
				</p:column>
				
				<p:column>
					<p:inputText
						value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.id}"
						maxlength="11" size="16" onkeypress="mascara(this, soNumeros)" />
				</p:column>
			</p:row>

			<p:row>
				<p:column styleClass="columnRight">
					<p:outputLabel value="Convênio"/>
				</p:column>
				
				<p:column>
					<p:selectOneMenu
					value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.convenios}"
						style="width:100%;" filter="true" filterMatchMode="contains" required="true">
						<f:selectItem itemValue="#{null}" itemLabel="" noSelectionOption="true" />
		          	 	<f:selectItems var="convenio" value="#{relatorioVigenciaTabelaTaxasComissoesBean.helper.convenios}"
							itemLabel="#{convenio.id} - #{convenio.nome}" itemValue="#{convenio}"/>
     				</p:selectOneMenu>					
				</p:column>
				
				<p:column styleClass="columnRight">
					<p:outputLabel value="Comissão"/>
				</p:column>
				
				<p:column>
					<p:inputText
						value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.comissao}"
						maxlength="6" size="11" onkeypress="mascara(this, valorMonetario)" styleClass="columnRight"/>
					&nbsp;
					<p:outputLabel value="%"/>
				</p:column>
			</p:row>
			
			<p:row>
				<p:column styleClass="columnRight">
					<p:outputLabel value="Situação da tabela"/>
				</p:column>

				<p:column>
					<p:selectOneButton value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.desativada}">  
        				<f:selectItem itemLabel="Ativa" itemValue="false" /> 
        				<f:selectItem itemLabel="Desativada" itemValue="true" />  
        				<f:selectItem itemLabel="Todas" itemValue="#{null}" />  
     				</p:selectOneButton> 							
				</p:column>
				
				<p:column styleClass="columnRight">
					<p:outputLabel value="Prazo"/>
				</p:column>
				
				<p:column>
					<p:inputText
						value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.prazoInicial}"
						maxlength="3" size="8" onkeypress="mascara(this, soNumeros)" styleClass="columnRight"/>
					&nbsp;&nbsp;a&nbsp;&nbsp;
					<p:inputText
						value="#{relatorioVigenciaTabelaTaxasComissoesBean.filter.prazoFinal}"
						maxlength="3" size="8" onkeypress="mascara(this, soNumeros)" styleClass="columnRight"/>
				</p:column>
			</p:row>
		</p:panelGrid>
		
		<div class="form_title"/>
		
		<div align="center">
			<p:commandButton value="Gerar relatório"/>
		</div>
		
	</h:form>
</h:body>
</html>
